#ifndef CIRRTETRABUFFER_H
#define CIRRTETRABUFFER_H

/*
Displays a CTetraBuffer graphically with irrlicht
*/

#include <irrlicht.h>
#include "ISceneNode.h"
#include "CTetraBuffer.h"
#include "IMesh.h"

/*
using namespace irr;
using namespace MarCore;
*/

namespace MarCore
{

class CIrrTetraBuffer : public ISceneNode
{

    core::aabbox3df bounding_box;

    scene::IMesh* mesh;

    video::SMaterial* material;

    /// Pointer to the tetra buffer irrlicht renders graphically
    CTetraBuffer* tetra_buffer;

public:

    //! Default constructor
    CIrrTetraBuffer();

    //! Constructor
    CIrrTetraBuffer( CTetraBuffer* tetra_buffer_new );

    addTetraMesh( CTetra* tetra );

    removeTetraMesh();

    //! If the CTetra vertices are changed, removed, added,
    //! then this will reload the graphics mesh, also updates
    //! bounding_box
    void updateMesh();

    core::aabbox3df* getBoundingBox();

    video::SMaterial* getMaterial();

    u32 getMaterialCount();

};
